package com.ecoolex.discount.sales.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   券猫<br>
 *<br>
 * 数据表： quan_mao_card
 *
 */
@Description({"券猫"})
public class QuanMaoCard implements Serializable {
    /**
     *
     *   产品编码    <br>
     *<br>
     * 字段名： quan_mao_card.CardNo
     */
    @Description({"产品编码", "不能为空", "数据长度: 190"})
    @NonNull
    private String cardNo;

    /**
     *
     *   产品名称    <br>
     *<br>
     * 字段名： quan_mao_card.CardName
     */
    @Description({"产品名称", "不能为空", "数据长度: 200"})
    @NonNull
    private String cardName;

    /**
     *
     *   卡类型(1直冲 2卡券)    <br>
     *<br>
     * 字段名： quan_mao_card.CardType
     */
    @Description({"卡类型(1直冲 2卡券)", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer cardType;

    /**
     *
     *   卡券类型（0无 1卡密 2二维码 3卡号 4链接）    <br>
     *<br>
     * 字段名： quan_mao_card.Type
     */
    @Description({"卡券类型（0无 1卡密 2二维码 3卡号 4链接）", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer type;

    /**
     *
     *   商品状态 0下架 1上架    <br>
     *<br>
     * 字段名： quan_mao_card.Status
     */
    @Description({"商品状态 0下架 1上架", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer status;

    /**
     *
     *   面值    <br>
     *<br>
     * 字段名： quan_mao_card.FaceValue
     */
    @Description({"面值", "不能为空", "数据长度: 18"})
    @NonNull
    private BigDecimal faceValue;

    /**
     *
     *   价格    <br>
     *<br>
     * 字段名： quan_mao_card.Price
     */
    @Description({"价格", "不能为空", "数据长度: 18"})
    @NonNull
    private BigDecimal price;

    /**
     *
     *   使用规则    <br>
     *<br>
     * 字段名： quan_mao_card.Remark
     */
    @Description({"使用规则", "数据长度: 500"})
    private String remark;

    /**
     *
     *   数据状态; 正常; 已删除;     <br>
     *<br>
     * 字段名： quan_mao_card.DataStatus
     */
    @Description({"数据状态; 正常; 已删除; ", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer dataStatus;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： quan_mao_card.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： quan_mao_card.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： quan_mao_card.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： quan_mao_card.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： quan_mao_card.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   产品编码    <br>
     *<br>
     * 字段名： quan_mao_card.CardNo
     */
    public String getCardNo() {
        return cardNo;
    }

    /**
     * 设置参数<br><br>
     *
     *   产品编码<br>
     *<br>
     * 字段名： quan_mao_card.CardNo
     */
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo == null ? null : cardNo.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   产品名称    <br>
     *<br>
     * 字段名： quan_mao_card.CardName
     */
    public String getCardName() {
        return cardName;
    }

    /**
     * 设置参数<br><br>
     *
     *   产品名称<br>
     *<br>
     * 字段名： quan_mao_card.CardName
     */
    public void setCardName(String cardName) {
        this.cardName = cardName == null ? null : cardName.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   卡类型(1直冲 2卡券)    <br>
     *<br>
     * 字段名： quan_mao_card.CardType
     */
    public Integer getCardType() {
        return cardType;
    }

    /**
     * 设置参数<br><br>
     *
     *   卡类型(1直冲 2卡券)<br>
     *<br>
     * 字段名： quan_mao_card.CardType
     */
    public void setCardType(Integer cardType) {
        this.cardType = cardType;
    }

    /**
     * 获取参数<br><br>
     *
     *   卡券类型（0无 1卡密 2二维码 3卡号 4链接）    <br>
     *<br>
     * 字段名： quan_mao_card.Type
     */
    public Integer getType() {
        return type;
    }

    /**
     * 设置参数<br><br>
     *
     *   卡券类型（0无 1卡密 2二维码 3卡号 4链接）<br>
     *<br>
     * 字段名： quan_mao_card.Type
     */
    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * 获取参数<br><br>
     *
     *   商品状态 0下架 1上架    <br>
     *<br>
     * 字段名： quan_mao_card.Status
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置参数<br><br>
     *
     *   商品状态 0下架 1上架<br>
     *<br>
     * 字段名： quan_mao_card.Status
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 获取参数<br><br>
     *
     *   面值    <br>
     *<br>
     * 字段名： quan_mao_card.FaceValue
     */
    public BigDecimal getFaceValue() {
        return faceValue;
    }

    /**
     * 设置参数<br><br>
     *
     *   面值<br>
     *<br>
     * 字段名： quan_mao_card.FaceValue
     */
    public void setFaceValue(BigDecimal faceValue) {
        this.faceValue = faceValue;
    }

    /**
     * 获取参数<br><br>
     *
     *   价格    <br>
     *<br>
     * 字段名： quan_mao_card.Price
     */
    public BigDecimal getPrice() {
        return price;
    }

    /**
     * 设置参数<br><br>
     *
     *   价格<br>
     *<br>
     * 字段名： quan_mao_card.Price
     */
    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    /**
     * 获取参数<br><br>
     *
     *   使用规则    <br>
     *<br>
     * 字段名： quan_mao_card.Remark
     */
    public String getRemark() {
        return remark;
    }

    /**
     * 设置参数<br><br>
     *
     *   使用规则<br>
     *<br>
     * 字段名： quan_mao_card.Remark
     */
    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   数据状态; 正常; 已删除;     <br>
     *<br>
     * 字段名： quan_mao_card.DataStatus
     */
    public Integer getDataStatus() {
        return dataStatus;
    }

    /**
     * 设置参数<br><br>
     *
     *   数据状态; 正常; 已删除; <br>
     *<br>
     * 字段名： quan_mao_card.DataStatus
     */
    public void setDataStatus(Integer dataStatus) {
        this.dataStatus = dataStatus;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： quan_mao_card.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： quan_mao_card.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： quan_mao_card.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： quan_mao_card.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： quan_mao_card.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： quan_mao_card.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： quan_mao_card.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： quan_mao_card.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： quan_mao_card.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： quan_mao_card.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        cardNo("CardNo", "cardNo", "VARCHAR", false),
        cardName("CardName", "cardName", "VARCHAR", false),
        cardType("CardType", "cardType", "INTEGER", false),
        type("Type", "type", "INTEGER", true),
        status("Status", "status", "INTEGER", true),
        faceValue("FaceValue", "faceValue", "DECIMAL", false),
        price("Price", "price", "DECIMAL", false),
        remark("Remark", "remark", "VARCHAR", false),
        dataStatus("DataStatus", "dataStatus", "INTEGER", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}